#define DEBUG
#include <cstdio>
#define ROOT 1
#define MAXN 50000
#define MAXM 100000

using namespace std;

int min(int a, int b) {
  return a<b ? a : b;
}

class Graph {
public:
  int n, m, ind[MAXN+1], to[2*MAXM+1], link[2*MAXM+1], dfn[MAXN+1], low[MAXN+1], ans[MAXN+1];

  void addSide(int u, int v) {
    m++;
    to[m] = v;
    link[m] = ind[u];
    ind[u] = m;
  }

  void solve(int o, int fa) {
    static bool book[MAXN+1];
    static int size[MAXN+1];
    book[o] = true;
    low[o] = dfn[o] = ++dfn[0];
    ans[o] = 0, size[o] = 1;
    int temp=0;
    for (int i=ind[o]; i; i=link[i]) {
      if (!book[to[i]]) {
	solve(to[i], o);
	size[o]+=size[to[i]];
	low[o] = min(low[o], low[to[i]]);
	if (low[to[i]]>=dfn[o]) {
	  temp += size[to[i]];
	  ans[o] += size[to[i]]*(n-size[to[i]]-1);
	}
      } else if (to[i]!=fa) {
	low[o] = min(low[o], dfn[to[i]]);
      }
    }
    ans[o] = (ans[o]+(temp)*(n-temp-1))/2+n-1;
  }
};

int main() {
#ifdef DEBUG
  freopen("2.in", "r", stdin);
  freopen("2.out", "w", stdout);
#endif

  static Graph g;
  int n, m;
  scanf("%d %d", &n, &m);
  g.n = n;
  for (int i=1; i<=m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    g.addSide(u, v);
    g.addSide(v, u);
  }

  g.solve(1, 0);
  for (int i=1; i<=n; i++) {
    printf("%d\n", g.ans[i]);
  }

  fcloseall();
}
